<template lang="html">
  <div class="mySwiper swiper-container">
    <div class="swiper-wrapper">
      <div class="swiper-slide" v-if="picList && picList.length" v-for="item in picList">
        <a :href="item.src" target="_blank">
          <img :src="item.src">
        </a>
      </div>
    </div>
    <div class="swiper-pagination"></div>
  </div>
</template>

<script>
import Swiper from 'swiper';
import 'swiper/dist/css/swiper.min.css';
export default {
  name: 'banner',
  props: ['picList'],
  methods: {
    init() {
      this.setSwiper();
    },
    setSwiper() {
      let mySwiper = new Swiper('.swiper-container', {
          speed: 400,
          spaceBetween: 100,
          pagination : '.swiper-pagination'
      });
    }
  },
  mounted() {
    this.init();
  }
}
</script>

<style lang="scss" scoped>
@import "../../assets/scss/default.scss";
.mySwiper {
  width: 100%;
  height: 3.3rem;
  .swiper-slide {
    position: relative;
    img {
      width: 100%;
      height: 100%;
      // position: absolute;
      // left: 50%;
      // top: 50%;
      // margin-left: -50%;
      // margin-top: -50%;
    }
  }
}
</style>
